import request from "@/utils/axios";

export function addCar(params) {
  return request({
    url: "/doudou/productadd",
    method: "post",
    data: params,
  });
}

export function productupdate(params) {
  return request({
    url: "/doudou/productupdate",
    method: "post",
    data: params,
  });
}

export function login(params) {
  return request({
    url: "/user/login",
    method: "post",
    data: params,
  });
}
export function logout(params) {
  return request({
    url: "/user/logout",
    method: "get",
    data: params,
  });
}

export function getUserInfo(params) {
  return request({
    url: "/user/info/get",
    method: "get",
    data: params,
  });
}

export function getCarList(reqData) {
  return request({
    url: "/doudou/productList",
    method: "get",
    data: reqData,
  });
}

export function getCarById(params) {
  return request({
    url: `/doudou/productinfo/${params.id}`,
    method: "get",
    data: params,
  });
}

export function getCategoryList(params) {
  return request({
    url: "/doudou/categorylist",
    method: "get",
    data: params,
  });
}

// 分类删除
export function categorydel(reqData) {
  return request({
    url: "/doudou/categorydel",
    method: "post",
    data: reqData,
  });
}

export function categoryrangeadd(reqData) {
  return request({
    url: "/doudou/categoryrangeadd",
    method: "post",
    data: reqData,
  });
}

export function getUserList(reqData) {
  return request({
    url: "/doudou/productList",
    method: "get",
    data: reqData,
  });
}

export function updatecache(reqData) {
  return request({
    url: "/doudou/updatecache",
    method: "post",
    data: reqData,
  });
}
